{extend name="base/common"}

{block name="style"}
<link rel="stylesheet" href="__STATIC__/datepicker/bootstrap-datetimepicker.min.css">
<link rel="stylesheet" href="__STATIC__/iCheck/custom.css">
<link rel="stylesheet" href="__ADMIN__/css/chosen/chosen.css">
<style>
    .col-lg-1 {
        width: 13%;
    }
    .form-horizontal .control-label {
        padding-top: 7px;
        margin-bottom: 0;
        text-align: center;
    }
</style>
{/block}

{block name="page-header"}
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-10">
        <h2>入学指导</h2>
        <ol class="breadcrumb">
            <li>
                <a href="{:Url('Play/index')}">首页</a>
            </li>
            <li class="active">
                <strong>{empty name="msg"}新增{else/}修改{/empty}</strong>
            </li>
        </ol>
    </div>
    <div class="col-lg-2">

    </div>
</div>
{/block}

{block name="main"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5></h5>
                    <div class="ibox-tools">
                        <a href="javascript:window.history.go(-1);" class="btn btn-white btn-sm"><i class="fa fa-reply"></i> 返回</a>
                    </div>
                </div>
                <div class="ibox-content all">
                    <form id="form" class="form-horizontal" method="post">
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label><span style="color: red">*</span> 分校:</label>
                            </div>
                            <div class="col-lg-10">
                                <select name="fx" id="type"  class="form-control place" >
                                    {empty name="msg"}
                                    {volist name="place" id="cc"}
                                    <option value="{$cc.name}">{$cc.name}</option>
                                    {/volist}
                                    {else/}
                                    {volist name="place" id="gg"}
                                    <option value="{$gg.name}" {eq name="$msg.fx" value="$gg.name"} selected {/eq}>{$gg.name}</option>
                                    {/volist}
                                    {/empty}
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label><span style="color: red">*</span> 班主任:</label>
                            </div>
                            <div class="col-lg-10">
                                <select name="bzr" id="type"  class="form-control education" >
                                    {empty name="msg"}
                                    {volist name="name" id="cc"}
                                    <option value="{$cc.name}">{$cc.name}</option>
                                    {/volist}
                                    {else/}
                                    {volist name="name" id="gg"}
                                    <option value="{$gg.name}" {eq name="$msg.bzr" value="$gg.name"} selected {/eq}>{$gg.name}</option>
                                    {/volist}
                                    {/empty}
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label><span style="color: red">*</span> 考试年份:</label>
                            </div>
                            <div class="col-lg-10">
                                <select name="ksnf" id="type"  class="form-control name" >
                                    {empty name="msg"}
                                    {volist name="year" id="gg"}
                                    <option value="{$gg}">{$gg}</option>
                                    {/volist}
                                    {else/}
                                    {volist name="year" id="gg"}
                                    <option value="{$gg}" {eq name="$msg.ksnf" value="$gg"} selected {/eq}>{$gg}</option>
                                    {/volist}
                                    {/empty}
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label><span style="color: red">*</span> 报班项目:</label>
                            </div>
                            <div class="col-lg-10">
                                <select name="bbxm" id="type"  class="form-control project" >
                                    {empty name="msg"}
                                    {volist name="pro" id="gg"}
                                    <option value="{$gg.xm}">{$gg.xm}</option>
                                    {/volist}
                                    {else/}
                                    {volist name="pro" id="gg"}
                                    <option value="{$gg.xm}" {eq name="$msg.bbxm" value="$gg.xm"} selected {/eq}>{$gg.xm}</option>
                                    {/volist}
                                    {/empty}
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label><span style="color: red">*</span> 报班类型:</label>
                            </div>
                            <div class="col-lg-10 bblx">
                                <select name="bblx" id="type"  class="form-control subject" >
                                    {empty name="msg"}
                                    {volist name="ban" id="gg"}
                                    <option  value="{$gg.banxing}">{$gg.banxing}</option>
                                    {/volist}
                                    {else/}
                                    {volist name="ban" id="gg"}
                                    <option  value="{$gg.banxing}" {eq name="$msg.bblx" value="$gg.banxing"} selected {/eq} >{$gg.banxing}</option>
                                    {/volist}
                                    {/empty}
                                </select>
                            </div>
                        </div>
                        {empty name="msg"}
                        <div class="form-group" id="timeRange">
                            <div class="col-lg-1 text-right control-label">
                                <label><span style="color: red">*</span> 报名时间:</label>
                            </div>
                            <div class="col-lg-10">
                                <div class="date" >
                                    <input type="text" style="width: 40%;float: left;margin-right: 50px" placeholder="请输入报名时间" class="form-control datetimepicker" name="time"  value=""/>
                                </div>
                            </div>
                        </div>
                        {else/}
                        <div class="form-group" id="timeRange">
                            <div class="col-lg-1 text-right control-label">
                                <label><span style="color: red">*</span> 报名时间:</label>
                            </div>
                            <div class="col-lg-10">
                                <div class="date">
                                    <input type="text" style="width: 40%;float: left;margin-right: 50px" placeholder="请输入报名时间" class="form-control datetimepicker " name="time"  value="{$msg.time|time_format='Y-m-d'}"/>
                                </div>
                            </div>
                        </div>
                        {/empty}
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label><span style="color: red">*</span> 性别:</label>
                            </div>
                            <div class="col-lg-10">
                                <select name="xb" id="type"  class="form-control project" >
                                    {empty name="msg"}
                                    <option value="男">男</option>
                                    <option value="女">女</option>
                                    {else/}
                                    <option value="男" {eq name="$msg.xb" value="男"} selected {/eq}>男</option>
                                    <option value="女" {eq name="$msg.xb" value="女"} selected {/eq}>女</option>
                                    {/empty}
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label><span style="color: red">*</span> 入学年份:</label>
                            </div>
                            <div class="col-lg-10">
                                <select name="rxnf" id="type"  class="form-control name" >
                                    {empty name="msg"}
                                    {volist name="sch" id="gg"}
                                    <option value="{$gg}">{$gg}</option>
                                    {/volist}
                                    {else/}
                                    {volist name="sch" id="gg"}
                                    <option value="{$gg}" {eq name="$msg.rxnf" value="$gg"} selected {/eq}>{$gg}</option>
                                    {/volist}
                                    {/empty}
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label><span style="color: red">*</span> 所属院校:</label>
                            </div>
                            <div class="col-lg-10">
                                <select name="xx_dq" id="type"  class="form-control stage" >
                                    {empty name="msg"}
                                    {volist name="area" id="gg"}
                                    <option value="{$gg.val}" {eq name="$gg.val" value="浙江 A区"} selected {/eq}>{$gg.val}</option>
                                    {/volist}
                                    {else/}
                                    {volist name="area" id="gg"}
                                    <option value="{$gg.val}" {eq name="$msg.xx_dq" value="$gg.val"} selected {/eq}>{$gg.val}</option>
                                    {/volist}
                                    {/empty}
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label></label>
                            </div>
                            <div class="col-lg-10 xx_mc">
                                <select name="xx_mc" id="type"  class="form-control module" >
                                    {empty name="msg"}
                                    {volist name="school" id="gg"}
                                    <option value="{$gg.dx}" {eq name="$gg.dx" value="杭州电子科技大学"} selected {/eq}>{$gg.dx}</option>
                                    {/volist}
                                    {else/}
                                    {volist name="school" id="gg"}
                                    <option value="{$gg.dx}" {eq name="$msg.xx_mc" value="$gg.dx"} selected {/eq}>{$gg.dx}</option>
                                    {/volist}
                                    {/empty}
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label></label>
                            </div>
                            <div class="col-lg-10 xx_xy">
                                <select name="xx_xy" id="type"  class="form-control module" >
                                    {empty name="msg"}
                                    {volist name="home" id="gg"}
                                    <option value="{$gg.xy}">{$gg.xy}</option>
                                    {/volist}
                                    {else/}
                                    {volist name="home" id="gg"}
                                    <option value="{$gg.xy}" {eq name="$msg.xx_xy" value="$gg.xy"} selected {/eq}>{$gg.xy}</option>
                                    {/volist}
                                    {/empty}
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label></label>
                            </div>
                            <div class="col-lg-10 xx_zy">
                                <select name="xx_zy" id="type"  class="form-control module" >
                                    {empty name="msg"}
                                    {volist name="zy" id="gg"}
                                    <option value="{$gg.zy}">{$gg.zy}</option>
                                    {/volist}
                                    {else/}
                                    {volist name="zy" id="gg"}
                                    <option value="{$gg.zy}" {eq name="$msg.xx_zy" value="$gg.zy"} selected {/eq}>{$gg.zy}</option>
                                    {/volist}
                                    {/empty}
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label><span style="color: red">*</span> 目标院校:</label>
                            </div>
                            <div class="col-lg-10">
                                <select name="mb_dq" id="type"  class="form-control stage" >
                                    {empty name="msg"}
                                    {volist name="areas" id="gg"}
                                    <option value="{$gg.val}" {eq name="$gg.val" value="浙江 A区"} selected {/eq}>{$gg.val}</option>
                                    {/volist}
                                    {else/}
                                    {volist name="areas" id="gg"}
                                    <option value="{$gg.val}" {eq name="$msg.mb_dq" value="$gg.val"} selected {/eq}>{$gg.val}</option>
                                    {/volist}
                                    {/empty}
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label></label>
                            </div>
                            <div class="col-lg-10 mb_mc">
                                <select name="mb_mc" id="type"  class="form-control module" >
                                    {empty name="msg"}
                                    {volist name="schools" id="gg"}
                                    <option value="{$gg.dx}" {eq name="$gg.dx" value="杭州电子科技大学"} selected {/eq}>{$gg.dx}</option>
                                    {/volist}
                                    {else/}
                                    {volist name="schools" id="gg"}
                                    <option value="{$gg.dx}" {eq name="$msg.mb_mc" value="$gg.dx"} selected {/eq}>{$gg.dx}</option>
                                    {/volist}
                                    {/empty}
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label></label>
                            </div>
                            <div class="col-lg-10 mb_xy">
                                <select name="mb_xy" id="type"  class="form-control module" >
                                    {empty name="msg"}
                                    {volist name="homes" id="gg"}
                                    <option value="{$gg.xy}">{$gg.xy}</option>
                                    {/volist}
                                    {else/}
                                    {volist name="homes" id="gg"}
                                    <option value="{$gg.xy}" {eq name="$msg.mb_xy" value="$gg.xy"} selected {/eq}>{$gg.xy}</option>
                                    {/volist}
                                    {/empty}
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label></label>
                            </div>
                            <div class="col-lg-10 mb_zy">
                                <select name="mb_zy" id="type"  class="form-control module" >
                                    {empty name="msg"}
                                    {volist name="zys" id="gg"}
                                    <option value="{$gg.zy}">{$gg.zy}</option>
                                    {/volist}
                                    {else/}
                                    {volist name="zys" id="gg"}
                                    <option value="{$gg.zy}" {eq name="$msg.mb_zy" value="$gg.zy"} selected {/eq}>{$gg.zy}</option>
                                    {/volist}
                                    {/empty}
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label><span style="color: red">*</span> 应收金额(元):</label>
                            </div>
                            <div class="col-lg-10">
                                <input type="number" min="1" class="form-control form_title" name="money" value="{$msg.money || default='1'}">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label><span style="color: red">*</span> VIP编号:</label>
                            </div>
                            <div class="col-lg-10">
                                <input type="text" placeholder="请输入VIP编号"  class="form-control form_title" name="vip" value='{$msg.vip || default="$vip"}'>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label><span style="color: red">*</span> 姓名:</label>
                            </div>
                            <div class="col-lg-10">
                                <input type="text" placeholder="请输入姓名"  class="form-control form_title" name="name" value='{$msg.name || default="$na"}'>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label><span style="color: red">*</span> 电话:</label>
                            </div>
                            <div class="col-lg-10">
                                <input type="number" min="0" maxlength="11" class="form-control form_title" name="tel" value='{$msg.tel || default="$tel"}'>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label><span style="color: red">*</span> QQ:</label>
                            </div>
                            <div class="col-lg-10">
                                <input type="number" min="5" placeholder="请输入QQ"  class="form-control form_title" name="qq" value='{$msg.qq || default=""}'>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label><span style="color: red">*</span> 家长姓名:</label>
                            </div>
                            <div class="col-lg-10">
                                <input type="text" placeholder="请输入家长姓名"  class="form-control form_title" name="jzxm" value='{$msg.jzxm || default=""}'>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label><span style="color: red">*</span> 家长电话:</label>
                            </div>
                            <div class="col-lg-10">
                                <input type="number" min="0" placeholder="请输入家长电话" maxlength="11" class="form-control form_title" name="jzdh" value='{$msg.jzdh || default=""}'>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label>四级笔试成绩:</label>
                            </div>
                            <div class="col-lg-10">
                                <input type="number" min="0" class="form-control form_title" name="sjbs" value="{$msg.sjbs || default='0'}">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label>四级口语成绩:</label>
                            </div>
                            <div class="col-lg-10">
                                <input type="number" min="0" class="form-control form_title" name="sjky" value="{$msg.sjky || default='0'}">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label>六级笔试成绩:</label>
                            </div>
                            <div class="col-lg-10">
                                <input type="number" min="0" class="form-control form_title" name="ljbs" value="{$msg.ljbs || default='0'}">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label>六级口语成绩:</label>
                            </div>
                            <div class="col-lg-10">
                                <input type="number" min="0" class="form-control form_title" name="ljky" value="{$msg.ljky || default='0'}">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label>国家计算机等级考试:</label>
                            </div>
                            <div class="col-lg-10">
                                <input type="number" min="0" class="form-control form_title" name="jsj" value="{$msg.jsj || default='0'}">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label>QQ群:</label>
                            </div>
                            <div class="col-lg-10">
                                <select name="qqq" id="type"  class="form-control project" >
                                    {empty name="msg"}
                                    <option value="考研">考研</option>
                                    <option value="专升本">专升本</option>
                                    <option value="口译">口译</option>
                                    <option value="雅思">雅思</option>
                                    <option value="计算机">计算机</option>
                                    <option value="论文">论文</option>
                                    {/volist}
                                    {else/}
                                    <option value="考研" {eq name="$msg.qqq" value="考研"}  selected{/eq}>考研</option>
                                    <option value="专升本" {eq name="$msg.qqq" value="专升本"}  selected{/eq} >专升本</option>
                                    <option value="口译" {eq name="$msg.qqq" value="口译"}  selected{/eq} >口译</option>
                                    <option value="雅思" {eq name="$msg.qqq" value="雅思"}  selected{/eq} >雅思</option>
                                    <option value="计算机" {eq name="$msg.qqq" value="计算机"}  selected{/eq} >计算机</option>
                                    <option value="论文" {eq name="$msg.qqq" value="论文"}  selected{/eq} >论文</option>
                                    {/empty}
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label></label>
                            </div>
                            <div class="col-lg-10 qqqs">
                                <select name="qqqs" id="type"  class="chosen-select form-control" data-placeholder="--请选择--" multiple>
                                    {empty name="msg"}
                                    <option value="考研同年级VIP学员群">考研同年级VIP学员群</option>
                                    <option value="英语VIP精听精翻群">英语VIP精听精翻群</option>
                                    <option value="数学答疑群">数学答疑群</option>
                                    <option value="点对点政治群">点对点政治群</option>
                                    <option value="VIP论文群">VIP论文群</option>
                                    <option value="431金融学综合">431金融学综合</option>
                                    <option value="199/396VIP学员群">199/396VIP学员群</option>
                                    <option value="西方经济学VIP学员群">西方经济学VIP学员群</option>
                                    <option value="法硕VIP群">法硕VIP群</option>
                                    <option value="分校学员群">分校学员群</option>
                                    {else/}
                                    {volist name="$msg.qqqss" id="gg"}
                                        {volist name="$msg.qqqs" id="q"}
                                    <option value="{$gg}" {eq name="$q" value="$gg" } selected {/eq}>{$gg}</option>
                                        {/volist}
                                    {/volist}
                                    {/empty}
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-1 text-right control-label">
                                <label><span style="color: red">*</span> 抄送给老师</label>
                            </div>
                            <div class="col-lg-10">
                                <select name="teacher" id="type"  class="chosen-select form-control" data-placeholder="--请选择--">
                                    {empty name="msg"}
                                    {volist name="$teacher" id="gg"}
                                    <option value="{$gg.openid}">{$gg.name}</option>
                                    {/volist}
                                    {else/}
                                    {volist name="$teacher" id="gg"}
                                    <option value="{$gg.openid}" {eq name="$msg.teacherid" value="$gg.openid"} selected {/eq}>{$gg.name}</option>
                                    {/volist}
                                    {/empty}
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-1 control-label">
                                <label><span style="color: red">*</span> 学习计划:</label>
                            </div>
                            <div class="col-lg-10">
                                <textarea rows="10" cols="140" name="study">{$msg.study || default=''}</textarea>
                            </div>
                        </div>
                        <input type="hidden" name="id" value="{$msg.id || default=''}">
                        <div class="form-group">
                            <div class="col-lg-11 col-lg-offset-1">
                                <button class="btn btn-primary submit-btn post-put" type="button" target-form="form-horizontal" >发布</button>
                                <a class="btn btn-default" href="javascript:window.history.go(-1);">返回</a>
                            </div>
                        </div>
                        <div class="selblo"></div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{/block}

{block name="script"}
<script src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
<script src="__STATIC__/datepicker/bootstrap-datetimepicker.js"></script>
<script src="__STATIC__/iCheck/icheck.min.js"></script>
<script src="__ADMIN__/js/chosen.jquery.js"></script>
<script>
    $(function(){
        //    单选按钮
        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green'
        });
        highlight_subnav("{:Url('Play/school')}");
        //    时间日历
        $( ".datetimepicker" ).datetimepicker( {
            language:  'cn',
            format: 'yyyy-mm-dd',
            minView: "month",
            forceParse: false,
            todayBtn: true,
            autoclose: true,
            todayHighlight: 1,
            minuteStep: 5

        });
        //多选框
        $(".qqqs select" ).chosen({
            no_results_text: "没有找到该选项",
            allow_single_de: true,
            width:'100%',
            max_selected_options:'15'
        });
        selHeight($('.qqqs select'));
        function selHeight(e){
            e.find('ul').on('click',function(){
                var results = $(this ).next().find('.chosen-results' );
                var h= results.height();
                h=h-100;
                $('.selblo' ).animate({'height':h+'px'},100);
                //切出页面
                var hiddenProperty = 'hidden' in document ? 'hidden' :
                    'webkitHidden' in document ? 'webkitHidden' :
                        null;
                var visibilityChangeEvent = hiddenProperty.replace(/hidden/i, 'visibilitychange');
                var onVisibilityChange = function(){
                    if (!document[hiddenProperty]) {
                        //selgp.find('.search-field').find('input').on('blur');
                    }else{
                        e.find('.search-field').find('input').off('blur');
                    }
                };
                $(document).on(visibilityChangeEvent, onVisibilityChange);
            });
            e.find('.search-field').find('input').on('blur',function(){
                setTimeout(function(){
                    $('.selblo' ).animate({'height':'0'});
                },100)
            });
        }

        $("select[name='bbxm']").change(function () {
            var name = $("select[name='bbxm']").val();
            $(".bblx").empty();
            $.ajax({
                type:"post",
                url:"{:Url('Play/sel')}",
                data:{type:1,name:name},
                success:function(data){
                    if(data.code == 1){
                        var html = '<select name="bblx" id="type"  class="form-control subject" >';
                        var lists = data.data;
                        var len = lists.length;
                        for(var i = 0; i< len;i++){
                            var list = lists[i];
                            html+='<option  value="'+list.banxing+'">'+list.banxing+'</option>';
                        }
                        html+='</select>';
                        $(".bblx").append(html);
                    }
                }
            });
        })
        $("select[name='xx_dq']").change(function () {
            var name = $("select[name='xx_dq']").val();
            $(".xx_mc").empty();
            $(".xx_xy").empty();
            $(".xx_zy").empty();
            $.ajax({
                type:"post",
                url:"{:Url('Play/sel')}",
                data:{type:2,name:name},
                success:function(data){
                    if(data.code == 1){
                        var html = '<select name="xx_mc" id="type"  class="form-control module" >';
                        var lists = data.data;
                        var len = lists.length;
                        for(var i = 0; i< len;i++){
                            var list = lists[i];
                            html+='<option  value="'+list.dx+'">'+list.dx+'</option>';
                        }
                        html+='</select>';
                        $(".xx_mc").append(html);
                        var names = $("select[name='xx_mc']").val();
                        $.ajax({
                            type:"post",
                            url:"{:Url('Play/sel')}",
                            data:{type:3,name:names},
                            success:function(data){
                                if(data.code == 1){
                                    var html = '<select name="xx_xy" id="type"  class="form-control module" >';
                                    var lists = data.data;
                                    var len = lists.length;
                                    for(var i = 0; i< len;i++){
                                        var list = lists[i];
                                        html+='<option  value="'+list.xy+'">'+list.xy+'</option>';
                                    }
                                    html+='</select>';
                                    $(".xx_xy").append(html);
                                    var namess = $("select[name='xx_xy']").val();
                                    $(".xx_zy").empty();
                                    $.ajax({
                                        type:"post",
                                        url:"{:Url('Play/sel')}",
                                        data:{type:4,name:namess,names:names},
                                        success:function(data){
                                            if(data.code == 1){
                                                var html = '<select name="xx_zy" id="type"  class="form-control module" >';
                                                var lists = data.data;
                                                var len = lists.length;
                                                for(var i = 0; i< len;i++){
                                                    var list = lists[i];
                                                    html+='<option  value="'+list.zy+'">'+list.zy+'</option>';
                                                }
                                                html+='</select>';
                                                $(".xx_zy").append(html);
                                            }
                                        }
                                    });
                                }
                            }
                        });
                        $("select[name='xx_mc']").change(function () {
                            var name = $("select[name='xx_mc']").val();
                            $(".xx_xy").empty();
                            $(".xx_zy").empty();
                            $.ajax({
                                type:"post",
                                url:"{:Url('Play/sel')}",
                                data:{type:3,name:name},
                                success:function(data){
                                    if(data.code == 1){
                                        var html = '<select name="xx_xy" id="type"  class="form-control module" >';
                                        var lists = data.data;
                                        var len = lists.length;
                                        for(var i = 0; i< len;i++){
                                            var list = lists[i];
                                            html+='<option  value="'+list.xy+'">'+list.xy+'</option>';
                                        }
                                        html+='</select>';
                                        $(".xx_xy").append(html);
                                        var names = $("select[name='xx_xy']").val();
                                        $.ajax({
                                            type:"post",
                                            url:"{:Url('Play/sel')}",
                                            data:{type:4,name:names,names:name},
                                            success:function(data){
                                                if(data.code == 1){
                                                    var html = '<select name="xx_zy" id="type"  class="form-control module" >';
                                                    var lists = data.data;
                                                    var len = lists.length;
                                                    for(var i = 0; i< len;i++){
                                                        var list = lists[i];
                                                        html+='<option  value="'+list.zy+'">'+list.zy+'</option>';
                                                    }
                                                    html+='</select>';
                                                    $(".xx_zy").append(html);
                                                }
                                            }
                                        });
                                        $("select[name='xx_xy']").change(function () {
                                            var name = $("select[name='xx_xy']").val();
                                            var names = $("select[name='xx_mc']").val();
                                            $(".xx_zy").empty();
                                            $.ajax({
                                                type:"post",
                                                url:"{:Url('Play/sel')}",
                                                data:{type:4,name:name,names:names},
                                                success:function(data){
                                                    if(data.code == 1){
                                                        var html = '<select name="xx_zy" id="type"  class="form-control module" >';
                                                        var lists = data.data;
                                                        var len = lists.length;
                                                        for(var i = 0; i< len;i++){
                                                            var list = lists[i];
                                                            html+='<option  value="'+list.zy+'">'+list.zy+'</option>';
                                                        }
                                                        html+='</select>';
                                                        $(".xx_zy").append(html);
                                                    }
                                                }
                                            });
                                        })
                                    }
                                }
                            });
                        })
                    }
                }
            });
        })
        $("select[name='xx_mc']").change(function () {
            var name = $("select[name='xx_mc']").val();
            $(".xx_xy").empty();
            $(".xx_zy").empty();
            $.ajax({
                type:"post",
                url:"{:Url('Play/sel')}",
                data:{type:3,name:name},
                success:function(data){
                    if(data.code == 1){
                        var html = '<select name="xx_xy" id="type"  class="form-control module" >';
                        var lists = data.data;
                        var len = lists.length;
                        for(var i = 0; i< len;i++){
                            var list = lists[i];
                            html+='<option  value="'+list.xy+'">'+list.xy+'</option>';
                        }
                        html+='</select>';
                        $(".xx_xy").append(html);
                        var names = $("select[name='xx_xy']").val();
                        $.ajax({
                            type:"post",
                            url:"{:Url('Play/sel')}",
                            data:{type:4,name:names,names:name},
                            success:function(data){
                                if(data.code == 1){
                                    var html = '<select name="xx_zy" id="type"  class="form-control module" >';
                                    var lists = data.data;
                                    var len = lists.length;
                                    for(var i = 0; i< len;i++){
                                        var list = lists[i];
                                        html+='<option  value="'+list.zy+'">'+list.zy+'</option>';
                                    }
                                    html+='</select>';
                                    $(".xx_zy").append(html);
                                }
                            }
                        });
                        $("select[name='xx_xy']").change(function () {
                            var name = $("select[name='xx_xy']").val();
                            var names = $("select[name='xx_mc']").val();
                            $(".xx_zy").empty();
                            $.ajax({
                                type:"post",
                                url:"{:Url('Play/sel')}",
                                data:{type:4,name:name,names:names},
                                success:function(data){
                                    if(data.code == 1){
                                        var html = '<select name="xx_zy" id="type"  class="form-control module" >';
                                        var lists = data.data;
                                        var len = lists.length;
                                        for(var i = 0; i< len;i++){
                                            var list = lists[i];
                                            html+='<option  value="'+list.zy+'">'+list.zy+'</option>';
                                        }
                                        html+='</select>';
                                        $(".xx_zy").append(html);
                                    }
                                }
                            });
                        })
                    }
                }
            });
        })
        $("select[name='xx_xy']").change(function () {
            var name = $("select[name='xx_xy']").val();
            var names = $("select[name='xx_mc']").val();
            $(".xx_zy").empty();
            $.ajax({
                type:"post",
                url:"{:Url('Play/sel')}",
                data:{type:4,name:name,names:names},
                success:function(data){
                    if(data.code == 1){
                        var html = '<select name="xx_zy" id="type"  class="form-control module" >';
                        var lists = data.data;
                        var len = lists.length;
                        for(var i = 0; i< len;i++){
                            var list = lists[i];
                            html+='<option  value="'+list.zy+'">'+list.zy+'</option>';
                        }
                        html+='</select>';
                        $(".xx_zy").append(html);
                    }
                }
            });
        })

        $("select[name='mb_dq']").change(function () {
            var name = $("select[name='mb_dq']").val();
            $(".mb_mc").empty();
            $(".mb_xy").empty();
            $(".mb_zy").empty();
            $.ajax({
                type:"post",
                url:"{:Url('Play/sel')}",
                data:{type:2,name:name},
                success:function(data){
                    if(data.code == 1){
                        var html = '<select name="mb_mc" id="type"  class="form-control module" >';
                        var lists = data.data;
                        var len = lists.length;
                        for(var i = 0; i< len;i++){
                            var list = lists[i];
                            html+='<option  value="'+list.dx+'">'+list.dx+'</option>';
                        }
                        html+='</select>';
                        $(".mb_mc").append(html);
                        var names = $("select[name='mb_mc']").val();
                        $.ajax({
                            type:"post",
                            url:"{:Url('Play/sel')}",
                            data:{type:3,name:names},
                            success:function(data){
                                if(data.code == 1){
                                    var html = '<select name="mb_xy" id="type"  class="form-control module" >';
                                    var lists = data.data;
                                    var len = lists.length;
                                    for(var i = 0; i< len;i++){
                                        var list = lists[i];
                                        html+='<option  value="'+list.xy+'">'+list.xy+'</option>';
                                    }
                                    html+='</select>';
                                    $(".mb_xy").append(html);
                                    var namess = $("select[name='mb_xy']").val();
                                    $(".mb_zy").empty();
                                    $.ajax({
                                        type:"post",
                                        url:"{:Url('Play/sel')}",
                                        data:{type:4,name:namess,names:names},
                                        success:function(data){
                                            if(data.code == 1){
                                                var html = '<select name="mb_zy" id="type"  class="form-control module" >';
                                                var lists = data.data;
                                                var len = lists.length;
                                                for(var i = 0; i< len;i++){
                                                    var list = lists[i];
                                                    html+='<option  value="'+list.zy+'">'+list.zy+'</option>';
                                                }
                                                html+='</select>';
                                                $(".mb_zy").append(html);
                                            }
                                        }
                                    });
                                }
                            }
                        });
                        $("select[name='mb_mc']").change(function () {
                            var name = $("select[name='mb_mc']").val();
                            $(".mb_xy").empty();
                            $(".mb_zy").empty();
                            $.ajax({
                                type:"post",
                                url:"{:Url('Play/sel')}",
                                data:{type:3,name:name},
                                success:function(data){
                                    if(data.code == 1){
                                        var html = '<select name="mb_xy" id="type"  class="form-control module" >';
                                        var lists = data.data;
                                        var len = lists.length;
                                        for(var i = 0; i< len;i++){
                                            var list = lists[i];
                                            html+='<option  value="'+list.xy+'">'+list.xy+'</option>';
                                        }
                                        html+='</select>';
                                        $(".mb_xy").append(html);
                                        var names = $("select[name='mb_xy']").val();
                                        $.ajax({
                                            type:"post",
                                            url:"{:Url('Play/sel')}",
                                            data:{type:4,name:names,names:name},
                                            success:function(data){
                                                if(data.code == 1){
                                                    var html = '<select name="mb_zy" id="type"  class="form-control module" >';
                                                    var lists = data.data;
                                                    var len = lists.length;
                                                    for(var i = 0; i< len;i++){
                                                        var list = lists[i];
                                                        html+='<option  value="'+list.zy+'">'+list.zy+'</option>';
                                                    }
                                                    html+='</select>';
                                                    $(".mb_zy").append(html);
                                                }
                                            }
                                        });
                                        $("select[name='mb_xy']").change(function () {
                                            var name = $("select[name='mb_xy']").val();
                                            var names = $("select[name='mb_mc']").val();
                                            $(".mb_zy").empty();
                                            $.ajax({
                                                type:"post",
                                                url:"{:Url('Play/sel')}",
                                                data:{type:4,name:name,names:names},
                                                success:function(data){
                                                    if(data.code == 1){
                                                        var html = '<select name="mb_zy" id="type"  class="form-control module" >';
                                                        var lists = data.data;
                                                        var len = lists.length;
                                                        for(var i = 0; i< len;i++){
                                                            var list = lists[i];
                                                            html+='<option  value="'+list.zy+'">'+list.zy+'</option>';
                                                        }
                                                        html+='</select>';
                                                        $(".mb_zy").append(html);
                                                    }
                                                }
                                            });
                                        })
                                    }
                                }
                            });
                        })
                    }
                }
            });
        })
        $("select[name='mb_mc']").change(function () {
            var name = $("select[name='mb_mc']").val();
            $(".mb_xy").empty();
            $(".mb_zy").empty();
            $.ajax({
                type:"post",
                url:"{:Url('Play/sel')}",
                data:{type:3,name:name},
                success:function(data){
                    if(data.code == 1){
                        var html = '<select name="mb_xy" id="type"  class="form-control module" >';
                        var lists = data.data;
                        var len = lists.length;
                        for(var i = 0; i< len;i++){
                            var list = lists[i];
                            html+='<option  value="'+list.xy+'">'+list.xy+'</option>';
                        }
                        html+='</select>';
                        $(".mb_xy").append(html);
                        var names = $("select[name='mb_xy']").val();
                        $.ajax({
                            type:"post",
                            url:"{:Url('Play/sel')}",
                            data:{type:4,name:names,names:name},
                            success:function(data){
                                if(data.code == 1){
                                    var html = '<select name="mb_zy" id="type"  class="form-control module" >';
                                    var lists = data.data;
                                    var len = lists.length;
                                    for(var i = 0; i< len;i++){
                                        var list = lists[i];
                                        html+='<option  value="'+list.zy+'">'+list.zy+'</option>';
                                    }
                                    html+='</select>';
                                    $(".mb_zy").append(html);
                                }
                            }
                        });
                        $("select[name='mb_xy']").change(function () {
                            var name = $("select[name='mb_xy']").val();
                            var names = $("select[name='mb_mc']").val();
                            $(".mb_zy").empty();
                            $.ajax({
                                type:"post",
                                url:"{:Url('Play/sel')}",
                                data:{type:4,name:name,names:names},
                                success:function(data){
                                    if(data.code == 1){
                                        var html = '<select name="mb_zy" id="type"  class="form-control module" >';
                                        var lists = data.data;
                                        var len = lists.length;
                                        for(var i = 0; i< len;i++){
                                            var list = lists[i];
                                            html+='<option  value="'+list.zy+'">'+list.zy+'</option>';
                                        }
                                        html+='</select>';
                                        $(".mb_zy").append(html);
                                    }
                                }
                            });
                        })
                    }
                }
            });
        })
        $("select[name='mb_xy']").change(function () {
            var name = $("select[name='mb_xy']").val();
            var names = $("select[name='mb_mc']").val();
            $(".mb_zy").empty();
            $.ajax({
                type:"post",
                url:"{:Url('Play/sel')}",
                data:{type:4,name:name,names:names},
                success:function(data){
                    if(data.code == 1){
                        var html = '<select name="mb_zy" id="type"  class="form-control module" >';
                        var lists = data.data;
                        var len = lists.length;
                        for(var i = 0; i< len;i++){
                            var list = lists[i];
                            html+='<option  value="'+list.zy+'">'+list.zy+'</option>';
                        }
                        html+='</select>';
                        $(".mb_zy").append(html);
                    }
                }
            });
        })
        $("select[name='qqq']").change(function () {
            var name = $("select[name='qqq']").val();
            $('.qqqs' ).empty();
            $.ajax({
                type:"post",
                url:"{:Url('Play/sel')}",
                data:{type:5,name:name},
                success:function(data){
                    if(data.code == 1){
                        var html = '';
                        var lists = data.data;
                        var len = lists.length;
                        html += '<select class="chosen-select form-control" data-placeholder="--请选择--" name="qqqs" multiple>';
                        for(var i = 0; i< len;i++){
                            var list = lists[i];
                            html+='<option  value="'+list+'">'+list+'</option>';
                        }
                        html += '</select>';
                        $('.qqqs' ).append(html);
                        $(".qqqs select" ).chosen({
                            no_results_text: "没有找到该选项",
                            allow_single_de: true,
                            width:'100%',
                        });

                    }
                }
            });
        })
        //发布
        $(".post-put").off('click').on("click",function(){
            var it=$(this);
            if($("select[name='bblx']").val() == '' || $("select[name='bblx']").val() == null){
                updateAlert('请输入报班类型', 'error');
                return;
            }
            if($("input[name='time']").val() == '' || $("input[name='time']").val() == null){
                updateAlert('请输入报名时间', 'error');
                return;
            }
            if ($("select[name='xx_mc']").val() == null || $("select[name='xx_mc']").val() == ''){
                updateAlert('请选择所属院校', 'error');
                return;
            }
            if ($("select[name='mb_mc']").val() == null || $("select[name='mb_mc']").val() == ''){
                updateAlert('请选择目标院校', 'error');
                return;
            }
            if($("input[name='money']").val() == '' || $("input[name='money']").val() == null || $("input[name='money']").val() < 0){
                updateAlert('请输入金额', 'error');
                return;
            }
            if($("input[name='vip']").val() == '' || $("input[name='vip']").val() == null){
                updateAlert('请输入VIP编码', 'error');
                return;
            }
            if($("input[name='name']").val() == '' || $("input[name='name']").val() == null){
                updateAlert('请输入姓名', 'error');
                return;
            }
            if($("input[name='tel']").val() == '' || $("input[name='tel']").val() == null){
                updateAlert('请输入电话', 'error');
                return;
            }
            if($("input[name='qq']").val() == '' || $("input[name='qq']").val() == null){
                updateAlert('请输入QQ', 'error');
                return;
            }
            if($("input[name='jzxm']").val() == '' || $("input[name='jzxm']").val() == null){
                updateAlert('请输入家长姓名', 'error');
                return;
            }
            if($("input[name='jzdh']").val() == '' || $("input[name='jzdh']").val() == null){
                updateAlert('请输入家长电话', 'error');
                return;
            }
            if($("textarea[name='study']").val() == '' || $("textarea[name='study']").val() == null){
                updateAlert('请输入学习计划', 'error');
                return;
            }
            document.getElementsByClassName("post-put").disabled=true;
            var openid = "{$openid}";
            var data = {
                id:$("input[name='id']").val(),
                openid:openid,
                fx:$("select[name='fx']").val(),
                bzr:$("select[name='bzr']").val(),
                ksnf:$("select[name='ksnf']").val(),
                bbxm:$("select[name='bbxm']").val(),
                bblx:$("select[name='bblx']").val(),
                time:$("input[name='time']").val(),
                xb:$("select[name='xb']").val(),
                rxnf:$("select[name='rxnf']").val(),
                xx_dq:$("select[name='xx_dq']").val(),
                xx_mc:$("select[name='xx_mc']").val(),
                xx_xy:$("select[name='xx_xy']").val(),
                xx_zy:$("select[name='xx_zy']").val(),
                mb_dq:$("select[name='mb_dq']").val(),
                mb_mc:$("select[name='mb_mc']").val(),
                mb_xy:$("select[name='mb_xy']").val(),
                mb_zy:$("select[name='mb_zy']").val(),
                money:$("input[name='money']").val(),
                vip:$("input[name='vip']").val(),
                name:$("input[name='name']").val(),
                tel:$("input[name='tel']").val(),
                qq:$("input[name='qq']").val(),
                jzxm:$("input[name='jzxm']").val(),
                jzdh:$("input[name='jzdh']").val(),
                sjbs:$("input[name='sjbs']").val(),
                sjky:$("input[name='sjky']").val(),
                ljbs:$("input[name='ljbs']").val(),
                ljky:$("input[name='ljky']").val(),
                jsj:$("input[name='jsj']").val(),
                qqq:$("select[name='qqq']").val(),
                qqqs:$("select[name='qqqs']").val(),
                teacherid:$("select[name='teacher']").val(),
                teacher:$("select[name='teacher']").find("option:selected").text(),
                study:$("textarea[name='study']").val(),
            };
            it.prop('disabled','true');
            it.prev().prop('disabled','true');
            $.ajax({
                type:"post",
                url:$("#form").attr("action"),
                data:data,
                success:function(data){
                    it.removeAttr('disabled');
                    it.prev().removeAttr('disabled')
                    if(data.code == 1){
                        if (data.url) {
                            updateAlert(data.msg + ' 页面即将自动跳转~','success');
                        }else{
                            updateAlert(data.msg ,'success');
                        }
                        setTimeout(function(){
                            window.history.go(-1);
                        },2000);
                    } else {
                        updateAlert(data.msg, 'error');
                    }
                }
            });
            return false;
        });
    })

</script>
{/block}